/** Get node's position attribute converted to Pos enumeration values. */ private static Pos getPosition(Node n) { Node posNode = n.getAttributes().getNamedItem("position"); if (posNode == null) return null; String posString = posNode.getTextContent(); return Pos.fromString(posString); }