Q:

How to output two XML documents with PHP? 

I have these two documents, and in this stage I want to output both directly to browser.  When I am echoing first, or second document, everything is fine, but, when I try to output them both, I got this error:
XML Parsing Error: junk after document element at location where first XML document ends (...</response></epp>)and second element starts (<? xml version="1...). 
How do I output them both directly to browser?  You can see source output here. 

A:

You cannot directly output two XMLs, because the XML format requires only one root element, and in your case you echo two root elements.  Beside that, and more important, you output twice the <? xml version="1... part, which is not allowed more than once, and is required to be present at the beginning of the document. 
What you can do, if you want to return both within the same request, is to generate a third XML that aggregates the two roots by adding them as children to the root of the 3rd XML.  For example if your xml's look like
<? xml version="1.0"? >
<root1>
.....
</root1>

and
<? xml version="1.0"? >
<root2>
.....
</root2>

then the agregate xml would look like this:
<? xml version="1.0"? >
<root3>
    <root1>
    .....
    </root1>

    <root2>
    .....
    </root2>
</root3>

You can use an xml parser/writer to achieve this, or you can use brute force by using string manipulation in order to combine the two xml roots.