Q:

Get value from nested tag for XML contain in string

I'm trying to read value from nested tag from an XML and having trouble with it.  
My XML file called NewFile.xml  I'm trying read the value in tag4.
<?xml version="1.0"?>
    <tag1>
        <tag2>
            <tag3>
                <tag4>read me</tag4>
            </tag3>
        </tag2>
    </tag1>

Here is a main class called Test.java which reads that XML file and coverts it to string and sends it the the method called lookUpValue in reader class.
public class test {

    public static void main(String [] args) throws IOException, XPathExpressionException
    {
        BufferedReader br = new BufferedReader(new FileReader(new File("NewFile.xml")));
        String xmlString;   
        StringBuilder sb = new StringBuilder();

        while((xmlString=br.readLine())!= null){
            sb.append(xmlString.trim());
        }

        xmlString = sb.toString();

        System.out.print(reader.LookUpValue(xmlString));
        br.close();
    }   
}

Here is the reader class and the method LookupValue:
import java.io.StringReader;

import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import org.xml.sax.InputSource;

public class reader{

    public static String LookUpValue(String sb) throws XPathExpressionException
    {   
        InputSource source = new InputSource(new StringReader(sb));
        XPath xpath = XPathFactory.newInstance().newXPath();
        Object customer = xpath.evaluate("/tag1/tag2/tag3", source, XPathConstants.NODE);
        String value = xpath.evaluate("tag4", customer);

        return ("Value is: " + value);
    }
}

My question is how can I read the value inside tag4 right now when I run this program I get the following error. 
Exception in thread "main" 
javax.xml.transform.TransformerException: Unable to evaluate expression using this context
    at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:363)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:213)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:365)
    at reader.LookUpValue(LookUpValue.java:21)
    at test.main(test.java:26)
Caused by: java.lang.RuntimeException: Unable to evaluate expression using this context
    at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:212)
    at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:210)
    at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:335)
    ... 5 more
---------
java.lang.RuntimeException: Unable to evaluate expression using this context
    at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:212)
    at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:210)
    at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:335)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:213)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:365)
    at reader.LookUpValue(LookUpValue.java:21)
    at test.main(test.java:26)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:289)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:365)
    at reader.LookUpValue(LookUpValue.java:21)
    at test.main(test.java:26)
Caused by: javax.xml.transform.TransformerException: Unable to evaluate expression using this context
    at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:363)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:213)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
    ... 3 more
Caused by: java.lang.RuntimeException: Unable to evaluate expression using this context
    at com.sun.org.apache.xpath.internal.axes.NodeSequence.setRoot(NodeSequence.java:212)
    at com.sun.org.apache.xpath.internal.axes.LocPathIterator.execute(LocPathIterator.java:210)
    at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:335)
    ... 5 more

A:

import java.io.StringReader;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.xml.sax.InputSource;

public class reader {
    public static String LookUpValues(String sb) throws Exception{  

        DocumentBuilder builder = DocumentBuilderFactory
                .newInstance().newDocumentBuilder();
        InputSource src = new InputSource();
        src.setCharacterStream(new StringReader(sb));

        Document doc = builder.parse(src);
        String value = doc.getElementsByTagName("tag4").item(0).getTextContent();

        return ("Value is: " + value);
    }
}

