HtmlFilterReaderBase filterReader = new MapXmlFilterReader( inputReader, map );
String outputXml = new String( IOUtils.toCharArray( filterReader ) );
//System.out.println( outputXml );
//System.out.flush();
SimpleNamespaceContext ns = new SimpleNamespaceContext();
ns.bind( "n1", "http://hortonworks.com/xml/ns1" );
ns.bind( "n2", "http://hortonworks.com/xml/ns2" );
assertThat( the( outputXml ), hasXPath( "/n1:root", ns ) );
assertThat( the( outputXml ), hasXPath( "/n1:root/@attr1", ns, equalTo( "attr1-output" ) ) );
assertThat( the( outputXml ), hasXPath( "/n1:root/@n1:attr2", ns, equalTo( "attr2-output" ) ) );
assertThat( the( outputXml ), hasXPath( "/n1:root/text()[1]", ns, equalTo( "root-output1" ) ) );