I have the following layout defined in XML:
You just need the activity reference and call :
RelativeLayout relativeLayout = (RelativeLayout)activity.getLayoutInflater().inflate(R.layout.your_layout, null);
Then you can grab the two view using their ids
relativeLayout.findViewById(R.id.anId);