This illustration shows mapping to an XML document by position. Java class Address contains two attributes street1 and street2. Using XPath by position, you can map both to XML text nodes with the same name (STREET) with XPaths of street[1]/text() and street[2]/text(), respectively.